import file from "@src/models/file";
import {getID} from "@src/util/util";
import moment from "moment";

// 存储文件sql
const addFile = async (mimetype: string, path: string, size: number) => {
  const id = getID();
  await file.create({
    id,
    size,
    type: mimetype,
    path,
    created_at: moment().format("X"),
  });
  return id;
};

export default {
  addFile,
};